package co.com.javeriana.aes.oms.ejb.util.service;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.ejb.Stateless;

/**
 * Authentication web service
 * @author Jonathan Fernandez <jonathan.fvargas@gmail.com>
 */
@WebService(serviceName = "OmsAuthWebService")
@Stateless()
public class OmsAuthWebService {

    /**
     * 
     * @param username
     * @param password
     * @return 
     */
    @WebMethod(operationName = "validateUser")
    public boolean validateUser(@WebParam(name = "username") String username, @WebParam(name = "password") String password) {        
        return co.com.javeriana.aes.oms.ejb.util.ldap.connection.Connection.validateUser(username, password);
        //return co.com.javeriana.aes.oms.ejb.util.ldap.connection.Connection.getRandomBoolean();
    }
    
    
    /**
     * 
     * @param userName
     * @param password
     * @return 
     */    
    @WebMethod(operationName = "getUserPermission")
    public String getUserPermission(@WebParam(name = "userName") String userName, @WebParam(name = "password") String password) {        
        return co.com.javeriana.aes.oms.ejb.util.ldap.connection.Connection.getUserPermission(userName, password);
    }
    
}
